<%--
  @author Kusal Samarakoon
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">


    function validatePayment() {

        var pls_enter_valid_date = "Please Enter Valid Date";
        $("#gov-land-add-leasepayment-form").validate({
            rules:{
                endingDate:{
                    //required: true,
                    isFeatureDate:true
                },
                leasePeriod:{
                    required: true
                },
                leasePeriodWord:{
                    required: true
                },
                leaseDiagramNo:{
                    //required: true
                }
            },
            messages:{
                endingDate:{
                    required: "<br/>" + pls_enter_valid_date
                }
            }
        });

    }

</script>

<div id="land-registration-module-home-title" class="module-home-title">
    <s:a href="home.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                                 alt="Land Registration"><span><s:label
            value="%{getText('land_alienation.label')}"/></span></s:a>
    <span class="module-title-breaker">> </span>

    <s:a href="home.do">
                <img src="${pageContext.request.contextPath}/images/post_letter.png" alt="Alienation">
                <span><s:label value="%{getText('add_lease_payment_detail.label')}"/></span>
        </s:a>

    <div id="back-button" align="right">
        <s:submit type="input" value="%{getText('back.label')}" onclick="goBack();"/>
    </div>
</div>
<%--class="form-outer"--%>
<div id="init-land-permits-application-outer">
    <h3><s:property value="%{getText('add_lease_payment_detail.label')}"/></h3>
</div>

<s:form method="POST" id="gov-land-add-leasepayment-form"
        name="gov-land-add-leasepayment-form" enctype="multipart/form-data"
            onsubmit="javascript:return validateFormForInputDataSyntaxErrors('gov-land-add-leasepayment-form')">
    <table>

        <tr>
            <td>
                <s:label value="Start From"/>
                <s:label value="%{getText('date_format.label')}" cssClass="date-format"/></td>
            <td colspan="3"><s:textfield id="endingDate"
                                         name="landApplication.alienationDetails.leaseDetail.leaseStartDate"
                                         onKeyPress="return dateNumbersOnly(event,true)"/></td>
        </tr>

        <tr>
            <td><s:label value="Duration"/><span class="mandatory-field"></span></td>
            <td colspan="3"><s:textfield id="leasePeriod"
                                         name="landApplication.alienationDetails.leaseDetail.leasePeriod"
                                         onKeyPress="return dateNumbersOnly(event,true)"/></td>
        </tr>

        <tr>
            <td><s:label value="Duration in Words"/><span class="mandatory-field"></span></td>
            <td colspan="3"><s:textarea id="leasePeriodWord"
                                        name="landApplication.alienationDetails.leaseDetail.leasePeriodInWord"
                                        cssClass="width-200-px" rows="2"/></td>
        </tr>

        <tr>
            <td><s:label value="Premiun Amount(Rs)"/></td>
            <td colspan="3"><s:textfield id="premiunAmount" name="landApplication.alienationDetails.leaseDetail.premium"
                                         onKeyPress="return dateNumbersOnly(event,true)"/></td>
        </tr>

        <tr>
            <td><s:label value="Premiun Amount in Words(Rs)"/></td>
            <td colspan="3"><s:textarea id="premiunAmountWord"
                                        name="landApplication.alienationDetails.leaseDetail.premiumInWord"
                                        cssClass="width-200-px" rows="2"/></td>
        </tr>

        <tr>
            <td><s:label value="Anual Rental(Rs)"/></td>
            <td colspan="3"><s:textfield id="anualRental"
                                         name="landApplication.alienationDetails.leaseDetail.annualLeaseAmount"
                                         onKeyPress="return dateNumbersOnly(event,true)"/></td>
        </tr>

        <tr>
            <td><s:label value="Anual Rental in Words(Rs)"/></td>
            <td colspan="3"><s:textarea id="anualRentalWord"
                                        name="landApplication.alienationDetails.leaseDetail.annualLeaseAmountInWord"
                                        cssClass="width-200-px" rows="2"/></td>
        </tr>

        <tr>
            <td><s:label value="Lease Diagram Number"/><%--<span class="mandatory-field"></span>--%></td>
            <td colspan="3"><s:textfield id="leaseDiagramNo"
                                         name="landApplication.alienationDetails.leaseDetail.leaseDiagramNo"/></td>
        </tr>

        <tr>
            <td><s:label value="Field Sheet Number"/></td>
            <td colspan="3"><s:textfield id="fieldSheetNo"
                                         name="landApplication.alienationDetails.leaseDetail.fieldSheetNo"/></td>
        </tr>

        <tr>
            <td colspan="2">
                <s:submit value="%{getText('save.label')}" action="saveLeasePaymentDetail" onclick="validatePayment()"/>
                <s:submit value="%{getText('cancel.label')}" action="home"/>
                <s:hidden name="landApplication.id"/>
            </td>
        </tr>
    </table>

</s:form>